package com.htl.集合;

import java.util.Iterator;
import java.util.LinkedHashSet;

public class LinkedHashSet__test {
    public static void main(String[] args) {
        LinkedHashSet linkedHashSet = new LinkedHashSet();
//        linkedHashSet.add("Hello");
//        linkedHashSet.add("World");
//        linkedHashSet.add("Java");
//        linkedHashSet.add("Hello");
        for (int i = 0; i < 100; i++) {
            linkedHashSet.add(i);
        }
        System.out.println(linkedHashSet);
        System.out.println("-----------------------------------------");
        Iterator iterator = linkedHashSet.iterator();
        while (iterator.hasNext()){
            System.out.println(iterator.next());
        }
    }
}
